package pipeline;

import java.util.concurrent.TimeUnit;

/**
 * Created by Administrator on 2017/3/17.
 */
public interface Pipe<IN,OUT> {

    /**
     * 设置当前实例的下一个PIPE实例
     * @param nextPipe
     */
    void setNextPipe(Pipe<?,?> nextPipe);

    /**
     * 初始化当前Pipe实例对外提供的服务
     * @param pipeContext
     */
    void init(PipeContext pipeContext);

    void shutdown(long timeout, TimeUnit timeUnit);

    void process(IN input) throws InterruptedException;


}
